﻿
using System.Drawing;
using System.Collections.Generic;

namespace SurveySystem.Model
{
    /// <summary>
    /// Represents a single question in a <see cref="Survey"/>. A collection of these classes (held in <see cref="Survey.Questions"/>) 
    /// define the set of questions presented to a user when taking the survey. This class does not represent the results of a survey,
    /// these are represented by the <see cref="Response"/> and <see cref="ResponseAnswer"/> classes.
    /// </summary>
    public class Question
    {
        /// <summary>
        /// The ID field of this question (ideally unique across all surveys)
        /// </summary>
        public int QuestionID { get; set; }
        /// <summary>
        /// The ID field of the <see cref="Survey"/> object to which this question belongs
        /// </summary>
        public int SurveyID { get; set; }
        /// <summary>
        /// The question number, set externally, should represent the order questions are presented to the user
        /// </summary>
        public int QuestionNumber { get; set; }
        /// <summary>
        /// The text of this question
        /// </summary>
        public string QuestionText { get; set; }
        /// <summary>
        /// Whether or not completion of this question is required to complete the survey
        /// </summary>
        public bool Required { get; set; }
        /// <summary>
        /// Whether this question is select-one (false) or select-many (true)
        /// </summary>
        public bool MultiSelect { get; set; }
        /// <summary>
        /// The forground colour for the question. Will override <see cref="Survey.ForegroundColor"/>.
        /// </summary>
        public Color ForegroundColor { get; set; }
        /// <summary>
        /// The forground colour for the question. Will override <see cref="Survey.BackgroundColor"/>.
        /// </summary>
        public Color BackgroundColor { get; set; }
        /// <summary>
        /// List of <see cref="Answer"/> objects pertaining to this question
        /// </summary>
        public List<Answer> PossibleAnswers { get; set; }

        public Question()
        {
            QuestionID = -1;
            SurveyID = -1;
            QuestionNumber = 0;
            QuestionText = "";
            Required = false;
            MultiSelect = false;
            PossibleAnswers = new List<Answer>();
        }
    }
}
